﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master" Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.ItemCatProp>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	扩展属性
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.Partial("ETTree",ViewData["itemcats"]) %>
<div id="rightBox">    

	<div class="tabListBox">
    <table id="ETList" cellpadding="0" cellspacing="0">
	   <thead>
        <tr>            
			<th>
                属性名称
            </th>            
            <th>
                类型
            </th>
            <th>
                允许为空
            </th>            
            <th>
                是否关键属性
            </th>
             <th>
                是否颜色属性
            </th>
            <th>
                属性值
            </th> 
             <th>
                使用数
            </th>              
			<th>操作</th>
        </tr>
   </thead>
   <tbody>
    <% foreach (var item in ViewData["list"] as IEnumerable<MShop.Core.Domain.ItemCatProp>)
       { %>
    
        <tr>
           
            
            <td>
                <%: item.ItemProp.Name %>
            </td>
             <td>
                <%: item.ItemProp.ItemPropTypeToString() %>
            </td>
            <td>
                <%: item.ItemProp.Must ? "是" : "否"%>
            </td>
            <td>
                  <%: item.ItemProp.IsKeyProp ? "是" : "否"%>
            </td>            

            <td>
                 <%: item.ItemProp.IsColorProp?"是":"否" %>
            </td>
            <td>
             <%: item.ItemProp.PropValuesToString() %>
            </td>   
            <td>
            <%: item.ItemProp.ItemCatProp.Count %>
            </td>     
			<td>  
                <%=Html.ActionImageLink("/Content/remove.png", "Delete", new { id = item.Id,itemcatid=item.ItemCatId }, new {onclick="return confirm('确认删除该扩展字段吗？');" })%>
            </td>    
        </tr>
    
    <% } %>
    </tbody>
    </table>
    </div>


<div id="formOutBox" style="margin-top:10px;clear:both;">
  <div id="formTitle">
     <% if (Request.QueryString.Count > 0)
        { %>
	 <div class="formTitleCard_c">编辑属性</div>
     <%}
        else
        { %>
         <div class="formTitleCard_c">属性列表</div>
        


     <%} %>
  </div>
  
 <div id="formBox" style="height:250px;">
  
   <table width="100%" border="0" cellspacing="0" cellpadding="0" >
	   <thead>
        <tr>            
			<th>
                属性名称
            </th>            
            <th>
                类型
            </th>
            <th>
                允许为空
            </th>            
            <th>
                是否关键属性
            </th>
             <th>
                是否颜色属性
            </th>
            <th>
                属性值
            </th>    <th>
                使用数
            </th>                
			<th>操作</th>
        </tr>
   </thead>
    <tbody>
    <%  var listprop = ViewData["listprop"] as IEnumerable<MShop.Core.Domain.ItemProp>;%>
    <% foreach (var item in listprop)
       { %>
    <tr>
    <td>
      <%:item.Name %>
    </td>
      <td>
        <%:item.ItemPropTypeToString()%>
    </td>
      <td>
        <%=item.Must?"是":"否" %>
    </td>
      <td>
        <%:item.IsKeyProp?"是":"否" %>
    </td>
      <td>
        <%:item.IsColorProp?"是":"否" %>
    </td>   <td>
        <%=item.PropValuesToString()%>
    </td>
     <td>
            <%: item.ItemCatProp.Count %>
            </td>     
    <td>
         <%=Html.ActionLink("添加", "add", new { pid = item.Id,id=ViewContext.RouteData.Values["id"] })%>
    </td>
    </tr>
    <%} %>
    </tbody>
    </table>     
  </div>
</div>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">

<script type="text/javascript">
    $(document).ready(function () {
        $('#ExtendPropertyType').change(function () {
            // alert($('#ExtendPropertyType').val());
            if ($('#ExtendPropertyType').val() == '8' || $('#ExtendPropertyType').val() == '7') {
                $('#spanV').show();
            }
            else {
                $('#spanV').hide();
            }

        });

        var hide = '<%=Request.QueryString["eid"] %>';      
        if(hide!=''){
            $('#ExtendPropertyType').attr("disabled","disabled");
        }
        if(hide!='' &&( type=='7' || type=='8')){
             $('#spanV').show();
        }
             
    });
   
</script>


</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
<script type="text/javascript">
    $(document).ready(function () {
        var windowWidth = $("#rightBox").width();
        var windowHeight = $("#rightBox").height() - 310;
        $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        $(window).resize(function () {
            var windowWidth = $("#rightBox").width();
            var windowHeight = $("#rightBox").height() - 310;
            $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        });
        $('.tabListBox').fixedHeaderTable({ footer: false, cloneHeaderToFooter: false, autoResize: true, fixCol1: true });

        $('.tabListBox').find("tbody").find("tr").each(function (i) {
            if (i % 2 == 1) {
                $(this).find("td").addClass("tr1");
            }
        });
        $('.tabListBox').find("tbody").find("tr").mouseover(function (i) {
            $(this).find("td").addClass("tr0");
        });
        $('.tabListBox').find("tbody").find("tr").mouseout(function (i) {
            $(this).find("td").removeClass("tr0");
        });

    });
</script>
</asp:Content>

